<?php

/**
 *      [品牌空间] (C)2001-2010 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: sitenotice.php 4689 2010-10-27 06:30:41Z yumiao $
 */

define("CURSCRIPT", "sitenotice");
include_once('./common.php');

$itemid = intval($_GET['itemid']);
$active['sitenotice'] = ' class="active"';

if(empty($itemid)) {

	$multipage = $_SBLOCK['sitenotice_multipage'];
	$resultcount = $_SBLOCK['sitenotice_listcount'];
	$location['name'] = $_G['setting']['site_nav']['sitenotice']['name'];
	$seo_title = $location['name'] . " - " . $seo_title;

} else {

	$sitenotice = $_BCACHE->getiteminfo('notice', $itemid, 0);
	$sitenotice['message'] = bbcode2html($sitenotice['message']);
	if(!$sitenotice) {
		showmessage('not_found_msg', 'sitenotice.php');
	}
	$sitenotice['time'] = date('Y-m-d', $sitenotice['dateline']);
	updateviewnum('notice', $sitenotice['itemid']);

	if(!empty($sitenotice['jumpurl'])) {
		$sitenotice['jumpurl'] = str_replace('&amp;', '&', $sitenotice['jumpurl']);
		header("Location:$sitenotice[jumpurl]");
		exit();
	}

	$location['name'] = $_G['setting']['site_nav']['sitenotice']['name'];
	$seo_title = $sitenotice['subject'] . ' - ' . $location['name'] . " - " . $seo_title;
}

include template('templates/site/default/sitenotice.html.php', 1);
ob_out();

?>